package com.school.springboot_login.dao;

import com.school.springboot_login.bean.LoginLog;
import com.school.springboot_login.bean.LoginLog2;
import com.school.springboot_login.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.Date;

@Repository
public class LoginLog2Dao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public void insertLoginLog2(User user) {
        String sqlStr = "INSERT INTO 2loginlog(user_name, loginTimes, loginFailedTimes,time)"
                + "VALUES(?,?,?,?)";
        Object[] args = {user.getUserName(), user.getLoginTimes(),
                user.getLoginFailedTimes(),new Date()};
        jdbcTemplate.update(sqlStr, args);
    }
}
